//BASE_URL = "https://winsglobal.com/mobileapp/mobile_api/";
BASE_URL = "http://192.168.10.22/wnsgbl-repo/mobileapp/mobile_api/";

var app = new $.mvc.app();

app.loadModels("user");
app.loadControllers("user");
app.loadModels("garagesale");
app.loadControllers("garagesale");
app.loadModels("garagesale_item");
app.loadControllers("garagesale_item");
//Routing by hash change
//app.listenHashChange();


//$.mvc.addRoute("/garagesale_item",function(d){
//    console.log("Archive panel switch via hash change",arguments,d);
//})

//We wait until app.ready is available to fetch the data, then we wire up the existing data in the templates
app.ready(function(){//alert('test');
    if(localStorage.getItem('access_token')) {
        $.mvc.route("/garagesale");//Load the default todo route
    } else {
        //alert('there is no token');
        setTimeout(function () {
            $.ui.loadContent("#select",false,false,"up");
        }, 500);
    }
});